package itbour.onetouchshow.widget.inching;

import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.AppCompatImageView;
import android.util.AttributeSet;
import android.widget.RelativeLayout;

/**
 * Created by zjl_d on 2017/11/27.
 * 除图片外可操作控件 主要用于获取bitmap
 */

public class InchingOperaViewImg extends AppCompatImageView {


    public InchingOperaViewImg(Context context) {
        this(context, null);
    }

    public InchingOperaViewImg(Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public InchingOperaViewImg(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
//        this.context = context;


    }

    public void refreshView(int x, int y, int w, int h) {
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) (this).getLayoutParams();
        layoutParams.width = w;
        layoutParams.height = h;
        this.setLayoutParams(layoutParams);
        this.postInvalidate();
    }


}
